https://bugzilla.redhat.com//show_bug.cgi?id=812035 has
a stacktrace that shows recursion via
free_node -> unref -> dispose -> ui manager api
which ends in a crash, since we run free_node over the entire
tree and it leaves lots of dangling pointers behind.
So, better be careful by setting all pointers to NULL after
freeing them.
free_node (GNode *node)
{
Node *info = NODE_INFO (node);
-
+
g_list_free_full (info->uifiles, node_ui_reference_free);
+ info->uifiles = NULL;
- if (info->action)
- g_object_unref (info->action);
- if (info->proxy)
- g_object_unref (info->proxy);
- if (info->extra)
- g_object_unref (info->extra);
- g_free (info->name);
+ g_clear_object (&info->action);
+ g_clear_object (&info->proxy);
+ g_clear_object (&info->extra);
+ g_clear_pointer (&info->name, g_free);
g_slice_free (Node, info);
+ node->data = NULL;
return FALSE;
}